<?php
	$business = Business::singleton ();
			
	$section = $business->getSection (Section::TCURRENT);
	
	try
	{
		$db = Database::singleton ();
				
		$sth = $db->prepare ('SELECT * FROM magic.checkpoint WHERE _date = \''.date('d-m-Y').'\' AND func = '. User::singleton () ->getId());
				
		$sth->execute ();
		
		if( !$sth->rowCount ())
		{
			$sth = $db->prepare ('INSERT INTO magic.checkpoint (func, _date) VALUES ('.User::singleton () ->getId().', \''.date('d-m-Y').'\')');
			$sth->execute ();
		}
		
	}
	catch (PDOException $e)
	{
		throw new Exception ($e->getMessage ());
	}
	
	//throw new Exception (__ ('Wait! Working on your request...'));
	//throw new Exception (__ ('If do not have the <a href="http://www.getfirefox.com/">Mozilla Firefox</a> installed in your system, you can download it and install. For this, click at image below :<br /><a href="http://www.getfirefox.com/"><img style="margin: 15px 0px 0px 190px;" src="titan.php?target=loadFile&amp;file=interface/image/get.firefox.png" border="0" /></a>', 'TEXTO 1', 'TEXTO2'));
	//throw new Exception (__ ('If do not have the <a href="http://www.getfirefox.com/">Mozilla Firefox</a> installed in your system, you can download it and install. For this, click at image below', 'TEXTO1', 'TEXTO2'));
?>
<script language="javascript" type="text/javascript">
function runOnLoad ()
{
	showWait ();

	initDragableBoxesScript ();

	tAjax.delay (function () { hideWait (); });
}
</script>

<div id="idSearch" style="display: none;">
	<form id="formAddFeed" action="" method="post">
	<table align="center" border="0" width="100%" cellpadding="2" cellspacing="0">
		<tr>
			<td colspan="3" class="cTitle"><?= __ ('Insert New Feed RSS') ?></td>
		</tr>
	</table>
	<table align="center" border="1" width="100%" cellpadding="2" cellspacing="0" style="border: #36817C 1px solid; border-top-width: 3px;">
		<tr height="5px"><td></td></tr>
		<tr height="18px" style="background-color: #FFFFFF;">
			<td width="20%" nowrap style="text-align: right;"><b><?= __ ('URL of Feed RSS') ?>:</b></td>
			<td><input type="text" class="field" name="rssUrl" value="" maxlength="512" /></td>
		</tr>
		<tr height="2px"><td></td></tr>
		<tr height="18px" style="background-color: #F4F4F4;">
			<td width="20%" nowrap style="text-align: right;"><b><?= __ ('Quantity') ?>:</b></td>
			<td><input type="text" class="field" name="items" value="5" onkeypress="JavaScript: return formatInteger (this, event);" onkeyup="JavaScript: formatInteger (this,false);" /> <?= __ ('items') ?></td>
		</tr>
		<tr height="2px"><td></td></tr>
		<tr height="18px" style="background-color: #FFFFFF;">
			<td width="20%" nowrap style="text-align: right;"><b><?= __ ('Update on each') ?>:</b></td>
			<td><input type="text" class="field" name="reloadInterval" value="30" onkeypress="JavaScript: return formatInteger (this, event);" onkeyup="JavaScript: formatInteger (this,false);" /> <?= __ ('minutes') ?></td>
		</tr>
		<tr height="2px"><td></td></tr>
		<tr height="18px" style="background-color: #F4F4F4;">
			<td width="20%" nowrap style="text-align: right;"><b><?= __ ('Height (0 = auto)') ?>:</b></td>
			<td><input type="text" class="field" name="height" value="0" onkeypress="JavaScript: return formatInteger (this, event);" onkeyup="JavaScript: formatInteger (this,false);" /> pixels</td>
		</tr>
		<tr height="2px"><td></td></tr>
		<tr>
			<td></td>
			<td colspan="2">
				<input type="button" class="button" value="<?= __ ('Create') ?>" onclick="JavaScript: createFeed (this.form);" />
				<input type="button" class="button" value="<?= __ ('Cancel') ?>" onclick="JavaScript: showSearch ();" />
			</td>
		</tr>
		<tr height="5px"><td></td></tr>
	</table>
	</form>
</div>


<table style="width:400px; float:right; margin:20px" cellpadding="0" cellspacing="1" border="0">
<tr>
<?
$array = makeMenu2 ();

sort($array);

foreach ($array as $index => $menu)
{
	if($index %3 == 0)
		echo "</tr><tr>";
		
	echo "<td style='width:100px; padding:0'>". $menu ."</td>";
}
?>
</tr>
</table>
<div id="floatingBoxParentContainer"></div>
<div id="debug"></div>